package com.first.core.dao;

import java.io.Serializable;
import java.util.List;

import com.first.core.common.QueryFilter;
import com.first.core.util.Page;
import com.first.core.util.PageUtil;
import com.first.core.util.PagingBean;

public abstract interface GenericDao<T, PK extends Serializable> {
	
	//------------------------- hibernate 相关接口
	
	public abstract T save(T paramT);

	public abstract T merge(T paramT);

	public abstract T get(PK paramPK);

	public abstract void remove(PK paramPK);

	public abstract void remove(T paramT);

	public abstract void evict(T paramT);

	public abstract List<T> getAll();

	public abstract List<T> getAll(PagingBean paramPagingBean);

	public abstract List<T> getAll(QueryFilter paramQueryFilter);

	public abstract List<T> findByHql(String paramString,
			Object[] paramArrayOfObject);

	public abstract List<T> findByHql(String paramString,
			Object[] paramArrayOfObject, PagingBean paramPagingBean);

	public abstract List<T> findByHql(String paramString,
			Object[] paramArrayOfObject, int paramInt1, int paramInt2);

	public abstract void flush();

	public abstract void executeHql(String hql, Object[] objs);
	
	//------------------------- hibernate 相关接口   END.
	
	
	//------------------------- ibatis 相关接口

	public abstract List<T> ibGetAll();

	public abstract T ibGet(PK paramPK);

	public abstract boolean ibExists(PK paramPK);

	public abstract T ibSave(T paramT);

	public abstract void ibRemove(PK paramPK);

	public abstract PageUtil<T> ibFindQueryPage(Object paramObject,
			int paramInt1, int paramInt2);

	public abstract List<T> ibFindQueryPage(String paramString1,
			String paramString2, Object paramObject, Page paramPage);
	
	//------------------------- ibatis 相关接口   END.
}